<%@page import="news.entity.Admin"%>
<%@page import="news.biz.AdminBiz"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	request.setCharacterEncoding("UTF-8");
    response.setCharacterEncoding("UTF-8");
    
    String name=request.getParameter("loginId");
    String pwd=request.getParameter("password");
 
    AdminBiz adminBiz=new AdminBiz();
    Admin admin=adminBiz.adminLogin(name, pwd);
    
    if(admin!=null){
    	session.setAttribute("admin", admin);
    	response.sendRedirect("mainform.jsp");
    }else{
    	out.print("<script>alert('输入错误,请检查')</script>");
    	response.sendRedirect("index.jsp");
    }
    
 %>



